package com.redstar.HappyRefresh.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.redstar.HappyRefresh.mapper.VideoShareMapper;
import com.redstar.HappyRefresh.pojo.VideoShare;
import com.redstar.HappyRefresh.service.VideoShareService;
import org.springframework.stereotype.Service;

@Service
public class VideoShareServiceImpl extends ServiceImpl<VideoShareMapper, VideoShare> implements VideoShareService {
    @Override
    public Boolean saveVideoShare(VideoShare videoShare) { // 保存视频分享记录
        try {
            save(videoShare); // ip和videoId存在唯一索引，重复保存会抛出异常
        } catch (Exception e) {
            return false;
        }
        return true;
    }
}
